home *** CD-ROM | disk | FTP | other *** search
/ CDUTIL 13 / CDUTIL #13 Julio 1995.iso / windows / acadwin / support / acadr13.lsp < prev    next >
Encoding:
Lisp/Scheme  |  1995-02-08  |  10.8 KB  |  376 lines

  1. ; Next available MSG number is    86
  2. ; MODULE_ID ACADR13_LSP_
  3. ; $Id: acadr13.lsp,v 1.42 1994/11/21 12:12:25 johnfr Exp $
  4. ;;;    ACADR13.LSP Version 13.0 for Release 13 (8/9/94)
  5. ;;;
  6. ;;;    Copyright (C) 1994 by Autodesk, Inc.
  7. ;;;
  8. ;;;    Permission to use, copy, modify, and distribute this software
  9. ;;;    for any purpose and without fee is hereby granted, provided
  10. ;;;    that the above copyright notice appears in all copies and
  11. ;;;    that both that copyright notice and the limited warranty and
  12. ;;;    restricted rights notice below appear in all supporting
  13. ;;;    documentation.
  14. ;;;
  15. ;;;    AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
  16. ;;;    AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
  17. ;;;    MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK, INC.
  18. ;;;    DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
  19. ;;;    UNINTERRUPTED OR ERROR FREE.
  20. ;;;
  21. ;;;    Use, duplication, or disclosure by the U.S. Government is subject to
  22. ;;;    restrictions set forth in FAR 52.227-19 (Commercial Computer
  23. ;;;    Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) 
  24. ;;;    (Rights in Technical Data and Computer Software), as applicable.
  25. ;;;
  26. ;;;.
  27. ;;;
  28. ;;;    Note:
  29. ;;;            This file is loaded automatically by AutoCAD every time 
  30. ;;;            a drawing is opened.  It establishes an autoloader and
  31. ;;;            other utility functions.
  32. ;;;
  33. ;;;    Globalization Note:   
  34. ;;;            We do not support autoloading applications by the native 
  35. ;;;            language command call (e.g. with the leading underscore
  36. ;;;            mechanism.)
  37.  
  38. ;;;=== General Utility Functions ===
  39.  
  40. ;   R12 compatibility - In R12 (acad_helpdlg) was an externally-defined 
  41. ;   ADS function.  Now it's a simple AutoLISP function that calls the 
  42. ;   built-in function (help).  It's only purpose is R12 compatibility.  
  43. ;   If you are calling it for anything else, you should almost certainly 
  44. ;   be calling (help) instead. 
  45.  
  46. (defun acad_helpdlg (helpfile topic)
  47.   (help helpfile topic)
  48. )
  49.  
  50.  
  51. (defun *merr* (msg)
  52.   (setq *error* m:err m:err nil)
  53.   (princ)
  54. )
  55.  
  56. (defun *merrmsg* (msg)
  57.   (princ msg)
  58.   (setq *error* m:err m:err nil)
  59.   (princ)
  60. )
  61.  
  62. ;;; ===== Tutorial Utility Functions =====
  63.  
  64. ;;; If you can find the Toolbook Viewer and the Toolbook file, 
  65. ;;; start this Toolbook Tutorial
  66.  
  67. (defun playtbk (book / exe full fbook)
  68.   (setq exe   (findfile "tbook.exe"))
  69.  
  70.   (setq full (strcat book ".tbk"))
  71.   (if exe
  72.     (setq fbook 
  73.       (cond
  74.         ((findfile full))
  75.         ((findfile book))
  76.         (T nil) 
  77.       )
  78.     )
  79.   )
  80.   (if (and exe fbook)
  81.     (startapp exe fbook)
  82.     (alert "Imposible ejecutar el tutorial.")
  83.   )
  84. )
  85.  
  86. ;;; ===== AutoLoad =====
  87. ;;  
  88. ;;  Native Rx commands cannot be called with the "C:" syntax.  They must 
  89. ;;  be called via (command).  Therefore they require their own autoload 
  90. ;;  command.
  91.  
  92. (defun autonativeload (app cmdliste / qapp)
  93.   (setq qapp (strcat "\"" app "\""))
  94.   (setq initstring "\nInicializando...")
  95.   (mapcar
  96.    '(lambda (cmd / nom_cmd native_cmd)
  97.       (progn
  98.         (setq nom_cmd (strcat "C:" cmd))
  99.         (setq native_cmd (strcat "\"_" cmd "\""))
  100.         (if (not (eval (read nom_cmd)))
  101.             (eval
  102.              (read (strcat
  103.                     "(defun " nom_cmd "()"
  104.                     "(setq m:err *error* *error* *merrmsg*)"
  105.                     "(if (ai_ffile " qapp ")"
  106.                     "(progn (princ initstring)"
  107.                     "(_autoarxload " qapp ") (command " native_cmd "))"
  108.                     "(ai_nofile " qapp "))"
  109.                     "(setq *error* m:err m:err nil))"
  110.                     ))))))
  111.    cmdliste)
  112.   nil
  113. )
  114.  
  115. (defun _autoqload (quoi app cmdliste / qapp symnam)
  116.   (setq qapp (strcat "\"" app "\""))
  117.   (setq initstring "\nInicializando...")
  118.   (mapcar
  119.    '(lambda (cmd / nom_cmd)
  120.       (progn
  121.         (setq nom_cmd (strcat "C:" cmd))
  122.         (if (not (eval (read nom_cmd)))
  123.             (eval
  124.              (read (strcat
  125.                     "(defun " nom_cmd "( / rtn)"
  126.                     "(setq m:err *error* *error* *merrmsg*)"
  127.                     "(if (ai_ffile " qapp ")"
  128.                     "(progn (princ initstring)"
  129.                     "(_auto" quoi "load " qapp ") (setq rtn (" nom_cmd ")))"
  130.                     "(ai_nofile " qapp "))"
  131.                     "(setq *error* m:err m:err nil)"
  132.                     "rtn)"
  133.                     ))))))
  134.    cmdliste)
  135.   nil
  136. )
  137.  
  138. (defun autoload (app cmdliste)
  139.   (_autoqload "" app cmdliste)
  140. )
  141.  
  142. (defun autoxload (app cmdliste)
  143.   (_autoqload "x" app cmdliste)
  144. )
  145.  
  146. (defun autoarxload (app cmdliste)
  147.   (_autoqload "arx" app cmdliste)
  148. )
  149.  
  150. (defun _autoload (app)
  151. ; (princ "Auto:(load ") (princ app) (princ ")") (terpri)
  152.   (load app)
  153. )
  154.  
  155. (defun _autoxload (app)
  156. ; (princ "Auto:(xload ") (princ app) (princ ")") (terpri)
  157.   (if (= app "region") (ai_select))
  158.   (xload app)
  159.   (if (= app "region") (ai_amegrey "~"))
  160. )
  161.  
  162. (defun _autoarxload (app)
  163. ; (princ "Auto:(arxload ") (princ app) (princ ")") (terpri)
  164.   (arxload app)
  165. )
  166.  
  167. (defun ai_ffile (app)
  168.   (or (findfile (strcat app ".lsp"))
  169.       (findfile (strcat app ".exp"))
  170.       (findfile (strcat app ".exe"))
  171.       (findfile (strcat app ".arx"))
  172.       (findfile app)
  173.   )
  174. )
  175.  
  176. (defun ai_nofile (filename)
  177.   (princ
  178.     (strcat "\nEl archivo "
  179.             filename
  180.             "(.lsp/.exp/.exe/.arx) no estß en los directorios del camino de b·squeda."
  181.     )
  182.   )
  183.   (princ "\nCompruebe la instalaci≤n de los archivos de soporte e intΘntelo de nuevo.")
  184.   (princ)
  185. )
  186.  
  187.  
  188. ;;;===== AutoLoad LISP Applications =====
  189.  
  190. (autoload "appload" '("appload" "appload"))
  191.  
  192. (autoload "edge"  '("edge"))
  193.  
  194. (autoload "filter" '("filter " "filter"))
  195.  
  196. (autoload "3d" '("3d" "3d" "ai_box" "ai_pyramid" "ai_wedge" "ai_dome"
  197.                  "ai_mesh" "ai_sphere" "ai_cone" "ai_torus" "ai_dish")
  198. )
  199.  
  200. (autoload "ddinsert" '("ddinsert"))
  201.  
  202. (autoload "ddattdef" '("ddattdef"))
  203.  
  204. (autoload "ddattext" '("ddattext"))
  205.  
  206. (autoload "3darray" '("3darray"))
  207.  
  208. (autoload "ddmodify" '("ddmodify"))
  209.  
  210. (autoload "ddchprop" '("ddchprop"))
  211.  
  212. (autoload "ddview" '("ddview"))
  213.  
  214. (autoload "ddvpoint" '("ddvpoint"))
  215.  
  216. (autoload "mvsetup" '("mvsetup"))
  217.  
  218. (autoload "ddosnap" '("ddosnap"))
  219.  
  220. (autoload "ddptype" '("ddptype"))
  221.  
  222. (autoload "dducsp" '("dducsp"))
  223.  
  224. (autoload "ddunits" '("ddunits"))
  225.  
  226. (autoload "ddgrips" '("ddgrips"))
  227.  
  228. (autoload "ddselect" '("ddselect"))
  229.  
  230. (autoload "ddrename" '("ddrename"))
  231.  
  232. (autoload "ddcolor" '("ddcolor"))
  233.  
  234. (autoload "xrefclip" '("xrefclip"))
  235.  
  236. (autoload "attredef" '("attredef"))
  237.  
  238. (autoload "xplode" '("xp" "xplode"))
  239.  
  240. ;;;===== Autoload platform-specific applications =====
  241.  
  242. (if (wcmatch (getvar "platform") "*DOS*")
  243.     (autoload "r13new" '("whatsnew" "whatsnew"))
  244.     (autoload "tutorial" '("tutdemo" "tutclear"
  245.                        "tutdemo" 
  246.                        "tutclear"))
  247. )
  248.  
  249. ;;;===== AutoXLoad ADS Applications =====
  250.  
  251. (autoxload "rasterin" '( "gifin"    "riaspect"    "pcxin"    
  252.              "riedge"    "rigamut"    "rigrey"
  253.              "ribackg"    "rithresh"    "tiffin"
  254.             "gifin" "pcxin"
  255.             "riaspect" "ribackg"
  256.             "riedge" "rigamut"
  257.             "rigrey" "rithresh"
  258.             "tiffin")
  259. )
  260.  
  261. (autoxload "geomcal" '("cal" "cal"))
  262.  
  263. (autoxload "geom3d" '("mirror3d" "rotate3d" "align"
  264.               "simetria3d" "gira3d" 
  265.                                  "alinear"))
  266.  
  267. (autoxload "hpmplot" ' ("hpconfig" "hprender" "hpmplot"
  268.             "hpconfig" "hprender" 
  269.                                   "hpmplot"))
  270.  
  271. ;;;===== AutoArxLoad Arx Applications =====
  272.  
  273. (defun AutoVisionPresent ()
  274.   (setq AutoVisionPresent
  275.     (list '()
  276.       (and
  277.           (getenv "ACAD")
  278.           (wcmatch
  279.             (strcase (getenv "ACAD") T)
  280.             "*avis_sup*"
  281.           )
  282.           (findfile "autovis.arx")
  283.       )
  284.     )
  285.   )
  286. )
  287.  
  288. (AutoVisionPresent)
  289.  
  290. (defun autoloadrender (/ filedia cmdecho)
  291.   (if (AutoVisionPresent)
  292.       (progn (autoarxload "autovis" '("render"  "rpref"  "rmat"       "light" 
  293.                       "matlib"  "replay" "saveimg"    "3dsin" 
  294.                       "3dsout"  "vlconv" "rconfig"    "scene"
  295.                                       "stats"   "setuv"  "showmat"    "rfileopt"
  296.                                       "rendscr" "fog"    "background" "lsnew"
  297.                                       "lsedit"  "lslib"
  298.                       "render"
  299.                                       "rpref" 
  300.                                       "materialr"
  301.                                       "luz" 
  302.                                       "bibliomat"
  303.                                       "reproducir" 
  304.                                       "guardarimg"
  305.                                       "cargar3ds" 
  306.                                       "salvar3ds"
  307.                                       "convervl" 
  308.                                       "configr"
  309.                                       "escena" 
  310.                                       "estadist"
  311.                                       "mapeado"
  312.                                       "mostrmat"
  313.                                       "rfileopt"
  314.                                       "pantr"
  315.                                       "niebla"
  316.                                       "fondo"
  317.                                       "nvpaisaje"
  318.                                       "edpaisaje"
  319.                                       "bibpaisaje"))
  320.          (autoload "anim" '("animate" "animation"
  321.                 "animar"
  322.                 "animation"))
  323.  
  324.         )
  325.                               
  326.        (autoarxload "render" '("render"  "rpref"   "rmat"    "light"    
  327.                                "matlib"  "replay"  "saveimg" "3dsin"
  328.                                "3dsout"  "vlconv"  "rconfig" "scene"
  329.                    "showmat" "rendscr" "stats"
  330.                   "render"
  331.                               "rpref" 
  332.                               "materialr"
  333.                               "luz" 
  334.                               "bibliomat"
  335.                               "reproducir" 
  336.                               "guardarimg" 
  337.                               "cargar3ds" 
  338.                               "salvar3ds"
  339.                               "convervl" 
  340.                               "configr"
  341.                               "escena" 
  342.                               "mostrmat" 
  343.                               "pantr" 
  344.                               "estadist"))
  345.    )
  346. )
  347. (autoloadrender)
  348.  
  349. (defun C:RENDERUNLOAD ()
  350.   (if (if (autovisionPresent)
  351.         (arxunload "autovis" nil)
  352.         (arxunload "render" nil)
  353.       )
  354.       (progn
  355.         (autoloadrender)
  356.         (princ "\nSe ha descargado Render de la memoria. ")
  357.       )
  358.       (princ "\nRender no estß cargado. ")
  359.   )
  360.   (princ)
  361. )
  362.  
  363. (defun autoloadase ()
  364.   (autonativeload "ase" '("aseadmin"    "aserows"    "aselinks"
  365.             "aseselect"    "aseexport"    "asesqled"
  366.             "aseadmin" 
  367.             "aserows" 
  368.             "aselinks" 
  369.             "aseselect" 
  370.             "aseexport" 
  371.             "asesqled"))
  372. )
  373. (autoloadase)
  374.  
  375. (princ)
  376.